package com.ecp.commons.bean;

import com.ecp.commons.serialization.Variant;
import com.ecp.commons.serialization.GenericBean;
import com.ecp.commons.annotation.VariantType;

public class IDS extends GenericBean {

	@Override
	public void defineVariantSet() {
		this.entity = "t_ids";
		map.put("tableName", new Variant().setLength(64).setPk(true).setNullable(false));
		map.put("nextValue", new Variant().setType(VariantType.INTEGER).setNullable(false));
		map.put("maxValue", new Variant().setType(VariantType.INTEGER));
		map.put("curValue", new Variant().setType(VariantType.INTEGER).setPersistent(false));
	}

	@Override
	public void resetValues() {
		this.set("tableName", "");
		this.set("nextValue", "");
		this.set("maxValue", "");
	}

	@Override
	public boolean needCached() {
		return false;
	}

	public String getTableName() {
		return this.getString("tableName");
	}

	public int getNextValue() {
		return this.getInt("nextValue");
	}

	public int getMaxValue() {
		return this.getInt("maxValue");
	}

	public int getCurValue() {
		return this.getInt("curValue");
	}

	public void setTableName(String tableName) {
		this.set("tableName", tableName);
	}

	public void setNextValue(int nextValue) {
		this.set("nextValue", nextValue);
	}

	public void setMaxValue(int maxValue) {
		this.set("maxValue", maxValue);
	}

	public void setCurValue(int curValue) {
		this.set("curValue", curValue);
	}
}